package com.gilight.base.service;

import com.gilight.base.base.exception.ServiceException;
import com.gilight.base.dto.UserDto;
import com.gilight.base.dto.uni.UserDTO;
import com.gilight.base.model.SysUser;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

/**
 * 用户操作类接口
 *
 * @Author: wuzz
 * @Date 2019/5/13 13:44
 */
public interface UserService {

    void login(SysUser sysUser);

    PageInfo findList(UserDto userDto);

    void addUser(SysUser sysUser);

    void edit(SysUser sysUser);

    void assign(Long userId, List<Long> roleIdList);

    void resetPassword(Long id);

    void updatePassword(SysUser sysUser);

    void delete(Map<String, Object> map);

    SysUser getUserById(Long id);

    void updateStatus(Long id, Integer status);

    void selectStudentByExamineeNumber(String examineeNumber);

    Map getCurrentUserAndDept();

    Map<String, Object> getProps(String userCode);

    SysUser selectByUserCode(String userCode);
    public String sendVerifyCode(
             String phone) throws ServiceException;

    public String register(
             String phone,
             String password,
             String verifyCode,
             String ip) throws ServiceException;

    public String bindPhone(
             String phone,
            String password,
            String verifyCode,
            Long userId) throws ServiceException;

    public String resetPassword(
            String phone,
            String password,
            String verifyCode) throws ServiceException;

    public UserDTO login(
            String phone,
            String password,
            Integer loginType,
            String raw,
            String ip) throws ServiceException;

    public String logout(
            String accessToken,
            Long userId) throws ServiceException;


    public UserDTO thirdPartLogin(
            Integer loginType,
            Long brandType, String ip,
            String raw) throws ServiceException;

    /**
     * 同步用户信息
     * @param nickname
     * @param avatarUrl
     * @param gender
     * @param birthday
     * @param accessToken
     * @param userId
     * @return
     * @throws ServiceException
     */
    public String syncUserInfo(
            String nickname,
            String avatarUrl,
            Integer gender,
            Long birthday,
            String accessToken,
            Long userId) throws ServiceException;

    /**
     * H5 页面签名
     * 当H5页面需要调用微信的API时，微信为防止DNS劫持等情况，他是需要对每个页面进行签名的
     *
     * @param url
     * @return
     * @throws ServiceException
     */
    public Object getH5Sign(
            String url) throws ServiceException;

    public Boolean checkLogin(
            String accessToken) throws ServiceException;

}
